"use strict";
cc._RF.push(module, 'd594fGS+ARH7KpLAfHwEXKr', 'endlist');
// script/endlist.js

'use strict';

var global = require('global');
cc.Class({
	extends: cc.Component,

	properties: {
		btnnode: cc.Node,
		jjcell: cc.Prefab
	},

	onLoad: function onLoad() {
		//生成结局cell
		this.createjj();
	},
	returnbtn: function returnbtn() {
		var _this = this;

		this.node.opacity = 0;
		cc.director.getScheduler().schedule(function () {
			_this.node.x += 20;
		}, this, 1 / 64, 63);
	},
	createjj: function createjj() {
		var len = global.endlist.length - 1;
		for (var i = len; i >= 1; i--) {
			var idx = len - i + 1,
			    jj = global.endlist[idx];
			var jjcell = cc.instantiate(this.jjcell);
			jjcell.parent = this.btnnode;
			var bhLabel = jjcell.getChildByName('gkButton').getChildByName('idx').getComponent(cc.Label);
			var desLabel = jjcell.getChildByName('gkButton').getChildByName('des').getComponent(cc.Label);
			if (jj.reach == 0) {
				bhLabel.string = '关卡' + jj.guanka;
				desLabel.string = '? ? ?';
			} else {
				bhLabel.string = '编号' + idx;
				desLabel.string = jj.des;
			}
		}
	}
	// update (dt) {},

});

cc._RF.pop();